package com.dendi.demo.controller;

import com.dendi.demo.dao.UserDao;
import com.dendi.demo.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping

public class UserController {
    @Autowired
    UserDao userDao;

    @RequestMapping(value = "/index",method = RequestMethod.GET)
    public String index(){
        return "HelloWord";

    }

    @RequestMapping("/getUserById/{id}")
    public User getUserById(@PathVariable("id") Integer id){

        return userDao.getUserById(id);
    }

}
